fastlane_version "1.106.2"

default_platform :ios

platform :ios do
  before_all do
  end

  desc "Runs all the tests"
  lane :test do
    cocoapods
    scan(
        scheme: "Antidote",
        device: "iPhone 7",
        clean: true
    )
  end

  desc "Create screenshots"
  lane :shots do
    snapshot
    # frameit
  end

  desc "Submit a new Beta Build to Apple TestFlight"
  desc "This will also make sure the profile is up to date"
  lane :beta do
    changelog = prompt(
      text: "Changelog: ",
      multi_line_end_keyword: "END"
    )

    changelog += "

# See full changelog at GitHub http://bit.ly/1MsDgUX

# You can help to translate Antidote to your language. See more information here http://bit.ly/1UqDDBX"

    increment_build_number
    cocoapods
    cert
    sigh
    gym(
      scheme: "Antidote",
      include_symbols: true,
      include_bitcode: false
    )

    testflight(changelog: changelog,
               skip_submission: false,
               distribute_external: true)
  end

  desc "Release app to the App Store"
  lane :release do
    appstore(
        force: false,
        skip_binary_upload: true,
        skip_screenshots: true,
        submit_for_review: true,
        automatic_release: true
    )
  end

  after_all do |lane|
  end

  error do |lane, exception|
  end
end
